package com.bw.find_module.find;

import com.bw.common.mvvm.model.BaseModel;
import com.bw.find_module.entity.RecommendEntity;
import com.bw.find_module.entity.hasattent.HasEntity;
import com.bw.network_sdk.RetrofitManager;
import com.bw.network_sdk.entity.BaseEntity;

import java.util.Map;

import io.reactivex.Observable;

public class FindModel extends BaseModel {
    public Observable<BaseEntity> requestFind(int offset,int pageCount,int tagId,String tagType, int userId) {
        Observable<RecommendEntity> recommendEntityObservable = RetrofitManager.getInstance().getRetrofit()
                .create(ApiService.class)
                        .requestFind(offset, pageCount, tagId, tagType, userId);
        return checkNetWork(recommendEntityObservable);
    }

    public Observable<BaseEntity> requestHas(int tagId,int userId){
        Observable<HasEntity> hasEntityObservable = RetrofitManager.getInstance()
                .getRetrofit()
                .create(ApiService.class)
                .requestHas(tagId, userId);
        return checkNetWork(hasEntityObservable);
    }
}
